package com.yao.mall.service;

import com.yao.mall.model.dto.AddressRequest;
import com.yao.mall.model.entity.Address;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yao.mall.model.vo.AddressVO;

import java.util.List;

/**
* @author jiahua.yao
* @description 针对表【address】的数据库操作Service
* @date 2024-03-04 13:51:57
*/
public interface AddressService extends IService<Address> {

    /**
     * 获取用户所有的地址
     * @return list
     */
    List<AddressVO> getAddress();

    /**
     * 添加地址
     * @param addressRequest 地址DTO
     * @return boolean
     */
    Boolean addAddress(AddressRequest addressRequest);

    /**
     * 更新地址
     * @param addressRequest 地址DTO
     * @return AddressVO
     */
    AddressVO updateAddress(AddressRequest addressRequest);

    /**
     * 删除地址
     * @param id 地址id
     * @return boolean
     */
    Boolean deleteAddress(Long id);

    /**
     * 切换默认地址
     * @param id 地址 id
     * @return boolean
     */
    Boolean changeDefaultAddress(Long id);
}
